<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/riscv.h File Reference</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('riscv_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">riscv.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="pico_8h_source.html">pico.h</a>&quot;</code><br />
<code>#include &quot;hardware/regs/rvcsr.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for riscv.h:</div>
<div class="dyncontent">
<div class="center"><img src="riscv_8h__incl.png" border="0" usemap="#ainclude_2hardware_2riscv_8h" alt=""/></div>
<map name="ainclude_2hardware_2riscv_8h" id="ainclude_2hardware_2riscv_8h">
<area shape="rect" title=" " alt="" coords="420,5,600,32"/>
<area shape="rect" href="pico_8h.html" title=" " alt="" coords="411,80,473,107"/>
<area shape="rect" title=" " alt="" coords="497,80,659,107"/>
<area shape="rect" href="common_2pico__base__headers_2include_2pico_2types_8h_source.html" title=" " alt="" coords="158,304,259,331"/>
<area shape="rect" title=" " alt="" coords="252,155,365,181"/>
<area shape="rect" href="common_2pico__base__headers_2include_2pico_2config_8h_source.html" title=" " alt="" coords="390,155,494,181"/>
<area shape="rect" href="platform_8h.html" title=" " alt="" coords="596,155,717,181"/>
<area shape="rect" href="error_8h_source.html" title=" " alt="" coords="741,155,836,181"/>
<area shape="rect" href="assert_8h_source.html" title=" " alt="" coords="5,379,111,405"/>
<area shape="rect" title=" " alt="" coords="74,453,157,480"/>
<area shape="rect" title=" " alt="" coords="211,379,281,405"/>
<area shape="rect" title=" " alt="" coords="306,379,381,405"/>
<area shape="rect" title=" " alt="" coords="173,229,337,256"/>
<area shape="rect" href="compiler_8h_source.html" title=" " alt="" coords="362,229,543,256"/>
<area shape="rect" href="sections_8h_source.html" title=" " alt="" coords="567,229,746,256"/>
<area shape="rect" href="panic_8h_source.html" title=" " alt="" coords="770,229,930,256"/>
<area shape="rect" title=" " alt="" coords="954,229,1165,256"/>
<area shape="rect" title=" " alt="" coords="1189,229,1340,256"/>
<area shape="rect" title=" " alt="" coords="357,304,548,331"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="riscv_8h__dep__incl.png" border="0" usemap="#ainclude_2hardware_2riscv_8hdep" alt=""/></div>
<map name="ainclude_2hardware_2riscv_8hdep" id="ainclude_2hardware_2riscv_8hdep">
<area shape="rect" title=" " alt="" coords="17,5,197,32"/>
<area shape="rect" href="hazard3_8h.html" title=" " alt="" coords="5,80,208,107"/>
</map>
</div>
</div>
<p><a href="riscv_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a51acbcbe0db34c805da8b1c1d214bdf3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#a51acbcbe0db34c805da8b1c1d214bdf3">_riscv_read_csr</a>(csrname)</td></tr>
<tr class="separator:a51acbcbe0db34c805da8b1c1d214bdf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f03bee789588e757c1ae061f7641350"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#a0f03bee789588e757c1ae061f7641350">_riscv_write_csr</a>(csrname,  data)</td></tr>
<tr class="separator:a0f03bee789588e757c1ae061f7641350"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd8797e274ffb62fbedd967aa2ade9c2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#afd8797e274ffb62fbedd967aa2ade9c2">_riscv_set_csr</a>(csrname,  data)</td></tr>
<tr class="separator:afd8797e274ffb62fbedd967aa2ade9c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32520a8d9472e5ba3c10ca2a4520600b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#a32520a8d9472e5ba3c10ca2a4520600b">_riscv_clear_csr</a>(csrname,  data)</td></tr>
<tr class="separator:a32520a8d9472e5ba3c10ca2a4520600b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a384ec39c17d53d2d6fab24c4d6c82423"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#a384ec39c17d53d2d6fab24c4d6c82423">_riscv_read_write_csr</a>(csrname,  data)</td></tr>
<tr class="separator:a384ec39c17d53d2d6fab24c4d6c82423"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6acb08c9d4382cf54439d627a5a5feab"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#a6acb08c9d4382cf54439d627a5a5feab">_riscv_read_set_csr</a>(csrname,  data)</td></tr>
<tr class="separator:a6acb08c9d4382cf54439d627a5a5feab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa83f5980e9b9c3c709b8f488e6589ce0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="riscv_8h.html#aa83f5980e9b9c3c709b8f488e6589ce0">_riscv_read_clear_csr</a>(csrname,  data)</td></tr>
<tr class="separator:aa83f5980e9b9c3c709b8f488e6589ce0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8abe66587774e2025f08674b9a64e2f5"><td class="memItemLeft" align="right" valign="top"><a id="a8abe66587774e2025f08674b9a64e2f5" name="a8abe66587774e2025f08674b9a64e2f5"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_read_csr</b>(csrname)&#160;&#160;&#160;_riscv_read_csr(csrname)</td></tr>
<tr class="separator:a8abe66587774e2025f08674b9a64e2f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aead558637cc118e4b067dc5602201c3e"><td class="memItemLeft" align="right" valign="top"><a id="aead558637cc118e4b067dc5602201c3e" name="aead558637cc118e4b067dc5602201c3e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_write_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_write_csr(csrname, data)</td></tr>
<tr class="separator:aead558637cc118e4b067dc5602201c3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1f51dbee4752f6e4853020f9a162720"><td class="memItemLeft" align="right" valign="top"><a id="aa1f51dbee4752f6e4853020f9a162720" name="aa1f51dbee4752f6e4853020f9a162720"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_set_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_set_csr(csrname, data)</td></tr>
<tr class="separator:aa1f51dbee4752f6e4853020f9a162720"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae83e38c84d0df6aec14cc7cb74dcd0ef"><td class="memItemLeft" align="right" valign="top"><a id="ae83e38c84d0df6aec14cc7cb74dcd0ef" name="ae83e38c84d0df6aec14cc7cb74dcd0ef"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_clear_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_clear_csr(csrname, data)</td></tr>
<tr class="separator:ae83e38c84d0df6aec14cc7cb74dcd0ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96bf97bea44cd4d2c8cf37ffd1119ca1"><td class="memItemLeft" align="right" valign="top"><a id="a96bf97bea44cd4d2c8cf37ffd1119ca1" name="a96bf97bea44cd4d2c8cf37ffd1119ca1"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_read_write_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_read_write_csr(csrname, data)</td></tr>
<tr class="separator:a96bf97bea44cd4d2c8cf37ffd1119ca1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca91014d4ae82407f26eb46da91ed6fe"><td class="memItemLeft" align="right" valign="top"><a id="aca91014d4ae82407f26eb46da91ed6fe" name="aca91014d4ae82407f26eb46da91ed6fe"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_read_set_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_read_set_csr(csrname, data)</td></tr>
<tr class="separator:aca91014d4ae82407f26eb46da91ed6fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89dfdbfc34df3e02e5d2db6fbf9d395f"><td class="memItemLeft" align="right" valign="top"><a id="a89dfdbfc34df3e02e5d2db6fbf9d395f" name="a89dfdbfc34df3e02e5d2db6fbf9d395f"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_read_clear_csr</b>(csrname,  data)&#160;&#160;&#160;_riscv_read_clear_csr(csrname, data)</td></tr>
<tr class="separator:a89dfdbfc34df3e02e5d2db6fbf9d395f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a06efa338a556b959322ca608e7a486ab"><td class="memItemLeft" align="right" valign="top"><a id="a06efa338a556b959322ca608e7a486ab" name="a06efa338a556b959322ca608e7a486ab"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_u</b> (uint32_t x)</td></tr>
<tr class="separator:a06efa338a556b959322ca608e7a486ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dc5c5009a85d86dd00a4de398159057"><td class="memItemLeft" align="right" valign="top"><a id="a3dc5c5009a85d86dd00a4de398159057" name="a3dc5c5009a85d86dd00a4de398159057"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_i</b> (uint32_t x)</td></tr>
<tr class="separator:a3dc5c5009a85d86dd00a4de398159057"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30fa4eb5161c9de64499001fca87dc24"><td class="memItemLeft" align="right" valign="top"><a id="a30fa4eb5161c9de64499001fca87dc24" name="a30fa4eb5161c9de64499001fca87dc24"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_u_hi</b> (uint32_t x)</td></tr>
<tr class="separator:a30fa4eb5161c9de64499001fca87dc24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5333b1a6fa33487fe94e93358dae11a5"><td class="memItemLeft" align="right" valign="top"><a id="a5333b1a6fa33487fe94e93358dae11a5" name="a5333b1a6fa33487fe94e93358dae11a5"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_b</b> (uint32_t x)</td></tr>
<tr class="separator:a5333b1a6fa33487fe94e93358dae11a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ea47a34407669502c909a96b422211b"><td class="memItemLeft" align="right" valign="top"><a id="a9ea47a34407669502c909a96b422211b" name="a9ea47a34407669502c909a96b422211b"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_s</b> (uint32_t x)</td></tr>
<tr class="separator:a9ea47a34407669502c909a96b422211b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af713bf419496f600e28d218c11293f45"><td class="memItemLeft" align="right" valign="top"><a id="af713bf419496f600e28d218c11293f45" name="af713bf419496f600e28d218c11293f45"></a>
static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_j</b> (uint32_t x)</td></tr>
<tr class="separator:af713bf419496f600e28d218c11293f45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81b21a267bebb8705e2145366c8ab0f7"><td class="memItemLeft" align="right" valign="top"><a id="a81b21a267bebb8705e2145366c8ab0f7" name="a81b21a267bebb8705e2145366c8ab0f7"></a>
static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_cj</b> (uint32_t x)</td></tr>
<tr class="separator:a81b21a267bebb8705e2145366c8ab0f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a065d26607ce38eb22d145b05a9ac3dd0"><td class="memItemLeft" align="right" valign="top"><a id="a065d26607ce38eb22d145b05a9ac3dd0" name="a065d26607ce38eb22d145b05a9ac3dd0"></a>
static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_cb</b> (uint32_t x)</td></tr>
<tr class="separator:a065d26607ce38eb22d145b05a9ac3dd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae0eead09e287101d9d1a85aca370489"><td class="memItemLeft" align="right" valign="top"><a id="aae0eead09e287101d9d1a85aca370489" name="aae0eead09e287101d9d1a85aca370489"></a>
static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>riscv_encode_imm_ci</b> (uint32_t x)</td></tr>
<tr class="separator:aae0eead09e287101d9d1a85aca370489"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a32520a8d9472e5ba3c10ca2a4520600b" name="a32520a8d9472e5ba3c10ca2a4520600b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32520a8d9472e5ba3c10ca2a4520600b">&#9670;&nbsp;</a></span>_riscv_clear_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_clear_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrci &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrc &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa83f5980e9b9c3c709b8f488e6589ce0" name="aa83f5980e9b9c3c709b8f488e6589ce0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa83f5980e9b9c3c709b8f488e6589ce0">&#9670;&nbsp;</a></span>_riscv_read_clear_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_read_clear_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    uint32_t __csr_tmp_u32; \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrci %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrc %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">    __csr_tmp_u32; \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="a51acbcbe0db34c805da8b1c1d214bdf3" name="a51acbcbe0db34c805da8b1c1d214bdf3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51acbcbe0db34c805da8b1c1d214bdf3">&#9670;&nbsp;</a></span>_riscv_read_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_read_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    uint32_t __csr_tmp_u32; \</div>
<div class="line">    asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrr %0, &quot;</span> #csrname : <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32)); \</div>
<div class="line">    __csr_tmp_u32; \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="a6acb08c9d4382cf54439d627a5a5feab" name="a6acb08c9d4382cf54439d627a5a5feab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6acb08c9d4382cf54439d627a5a5feab">&#9670;&nbsp;</a></span>_riscv_read_set_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_read_set_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    uint32_t __csr_tmp_u32; \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrsi %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrs %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">    __csr_tmp_u32; \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="a384ec39c17d53d2d6fab24c4d6c82423" name="a384ec39c17d53d2d6fab24c4d6c82423"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a384ec39c17d53d2d6fab24c4d6c82423">&#9670;&nbsp;</a></span>_riscv_read_write_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_read_write_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    uint32_t __csr_tmp_u32; \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrwi %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrrw %0, &quot;</span> #csrname <span class="stringliteral">&quot;, %1&quot;</span>: <span class="stringliteral">&quot;=r&quot;</span> (__csr_tmp_u32) : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">    __csr_tmp_u32; \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="afd8797e274ffb62fbedd967aa2ade9c2" name="afd8797e274ffb62fbedd967aa2ade9c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd8797e274ffb62fbedd967aa2ade9c2">&#9670;&nbsp;</a></span>_riscv_set_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_set_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrsi &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrs &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
<a id="a0f03bee789588e757c1ae061f7641350" name="a0f03bee789588e757c1ae061f7641350"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f03bee789588e757c1ae061f7641350">&#9670;&nbsp;</a></span>_riscv_write_csr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _riscv_write_csr</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">csrname, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">data&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    ({ \</div>
<div class="line">    if (__builtin_constant_p(data) &amp;&amp; !((data) &amp; -32u)) { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrwi &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;i&quot;</span> (data)); \</div>
<div class="line">    } <span class="keywordflow">else</span> { \</div>
<div class="line">        asm <span class="keyword">volatile</span> (<span class="stringliteral">&quot;csrw &quot;</span> #csrname <span class="stringliteral">&quot;, %0&quot;</span> : : <span class="stringliteral">&quot;r&quot;</span> (data)); \</div>
<div class="line">    } \</div>
<div class="line">})</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>
